System and method for online automation

ABSTRACT

A changepoint detector for modeling data received from at least one sensor in a process in the hydrocarbon industry. The data is segmented into a plurality of segments and for each segment a model is assigned and the data corresponding to the segment fit to that model. A plurality of segmentations are thus provided and these segmentations ar evaluated and assigned weights indicative of the fit of the models of the segmentation t the underlying data. The segmentation models are further used to calculate a result that may be input to a process control program.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a non-provisional application claiming priority fromU.S. Provisional Patent Application Ser. No. 61/105,184, filed on Oct.14, 2008 and entitled “SYSTEM AND METHOD FOR REAL-TIME MANAGEMENT OF ANAUTOMATED INDUSTRIAL PROCEDURE USING ONLINE DATA FUSION,” the teachingsof which are incorporated by reference herein as if reproduced in fullbelow.

FIELD

The present invention relates generally to process automation, and moreparticularly but not by limitation to real-time management of controlparameters by detecting changepoints in data streams and using thedetected changepoints to accurately model input data and thereby providea basis for timely and accurate adjustment of the control parameters.

BACKGROUND

In many industries, automated processes are now used for fabrication ofproducts, monitoring operation of systems, designing systems,interacting machinery with other objects and/or the like. In suchautomated industrial processes, there is a broad latitude of issues thatmay affect the process. These issues may cause a halt and/or break downof the automated industrial process, may degrade the operation of theautomated industrial process, may change the background, environmentand/or the like the automated industrial process is working in and somay change how the automated industrial process works, what theautomated industrial process achieves, the goal of the automatedindustrial process and/or the like.

One or more of the broad latitude of issues that may affect theautomated industrial process may arise during the automated industrialprocess causing real time changes to the operation of the automatedindustrial process. To mitigate such issues, forward looking models ofthe automated industrial process may be analyzed and used to control theautomated industrial process. Such models may be determined from resultsfrom prior processes, theoretically, experimentally and/or the like.Mitigation of such issues may also be achieved by obtaining data fromthe automated industrial process and/or the environment in which theautomated industrial process occurs and retroactively identifying theexistence of an issue.

Merely by way of example, in the hydrocarbon industry, the process ofdrilling into a hydrocarbon reservoir may be impeded by a wide varietyof problems and may require monitoring/interpretation of a considerableamount of data. Accurate measurements of downhole conditions, downholeequipment properties, geological properties, rock properties, drillingequipment properties, fluid properties, surface equipment propertiesand/or the like may be analyzed by a drilling crew to minimize drillingrisks, to make determinations as to how to optimize the drillingprocedure given the data and/or to detect/predict the likelihood of aproblem/decrease in drilling efficiency and/or the like.

Similarly, in hydrocarbon exploration, hydrocarbon extraction,hydrocarbon production, hydrocarbon transportation and/or the like manyconditions may be sensed and data gathered to provide for optimizingand/or preventing/mitigating issues/problems concerning the exploration,production and or transportation of hydrocarbons. Hydrocarbons areessentially a lifeblood of the modern industrial society, as such vastamounts of hydrocarbons are being prospected, retrieved and transportedon a daily basis. Associated with this industry are an enormous amountof sensors gathering enumerable amounts of data relevant to theexploration, production and or transportation of hydrocarbons.

To provide for safe and efficient exploration, production and ortransportation of hydrocarbons this data must be processed. Whilecomputers may be used to process the data, it is often difficult toaccurately process the incoming data for real-time control of thehydrocarbon processes. As such, human operators are commonly used tocontrol the hydrocarbon processes and to make decisions on optimizing,preventing risks, identifying faults and/or the like based oninterpretation of the raw/processed data. However, optimization of ahydrocarbon process and/or mitigation and detection of issues/problemsby a human controller may often be degraded by fatigue, high workload,lack of experience, the difficulty in manually analyzing complex dataand/or the like. Furthermore, noisy data may have a significant impacton a human observer's ability to take note of or understand the meaningoccurrences reflected in the data.

The detection of occurrences reflected in the data goes beyond detectionof issues and problems. Accurate analysis of operating conditions mayallow for an operator to operate the industrial process at near optimalconditions. For example, in the hydrocarbon industry, the bit-responseto changes in parameters such as drill-bit rotational speed andweight-on-bit (WOB) while drilling into a hydrocarbon reservoir is verymuch affected by changes in the lithological environment of drillingoperations. Accurate and real-time knowledge of a transition from oneenvironment to another, e.g., one formation to another, and real-timeanalysis of how such environmental conditions impact the effect thatparameter changes are likely to have on bit-response may greatly improvethe expected rate of penetration (ROP).

Similarly, the constraints that limit the range of the drillingparameters may change as the drilling environment changes. Theseconstraints, e.g., the rate at which cuttings are removed by thedrilling fluids, may limit the maximum permissible drilling parametervalues. Without accurate knowledge of these changes in the constraints,a driller may not be fully aware of where the constraints lie withrespect to the ideal parameter settings and for the sake of erring onthe side of caution, which is natural considering the dire consequencesof drilling equipment failures and drilling accidents, a driller mayoperate the drilling process at parameters far removed the actualoptimal parameters. Considering that drilling, like many other processesassociated with the production and transport of hydrocarbons is anextremely costly procedure, the operation of the drilling system at lessthan optimal parameters can be extremely costly.

Similarly, accurate measurement of the direction (Toolface) andcurvature (Dogleg-Severity (DLS)) of a borehole is necessary for adriller to accurately direct a drilling process to a target.Measurements of these properties are typically taken at ratherinfrequent intervals (e.g., every 30 to 90 feet) while the drill-bit isoff bottom and the drill string is stationary. However, modern drillingequipment may provide for taking directional measurements continuouslywhile drilling. Unfortunately, the measurements obtained while-drillingare generally very noisy and difficult for a driller to interpretbecause of the noise in the data.

Furthermore, the noise in the data tends to be amplified in any directcomputation of the Dogleg-Severity and Toolface from the continuoussurveys and the results are generally of such low quality to be oflittle value to the drillers. As a result, the while-drilling data isoften not used in computation of Dogleg-Severity, Toolface and/or thelike and instead the infrequent measurements, which require the drillingprocess to be halted while the measurements are taken, are often stillused to determine drilling trajectory and/or the like.

In the hydrocarbon industry, as in other industries, event detectionsystems have generally depended upon people, such as drilling personnel,to manage processes and to identify occurrences of events, such as achange in a rig state. Examples of rig state detection in drilling maybe found in the following references: “The MDS System: ComputersTransform Drilling”, Bourgois, Burgess, Rike, Unsworth, Oilfield ReviewVol. 2, No. 1, 1990, pp. 4-15; and “Managing Drilling Risk” Aldred etal., Oilfield Review, Summer 1999, pp. 219.

With regard to the hydrocarbon industry, some very limited techniqueshave been used for detecting a certain type of event, i.e., possible rigstates, such as “in slips”, “not in slips”, “tripping in” or “trippingout”. These systems take a small set of rig states, where each rig stateis an intentional drilling state, and use probability analysis toretroactively determine which of the set of intentional drilling statesthe rig has moved into. Probabilistic rig state detection is describedin U.S. Pat. No. 7,128,167, the entirety of which is hereby incorporatedby reference for all purposes.

In the hydrocarbon industry, there are ever more and better sensors forsensing data related to the exploration, extraction, production and/ortransportation of the hydrocarbons. To better control/automate processesrelated to the exploration, extraction, production and/or transportationof the hydrocarbons and/or to better process/interpret the data forhuman controllers/operators of the processes related to the exploration,extraction, production and/or transportation of the hydrocarbons thesensed data associated with the processes must be quickly andeffectively handled.

SUMMARY

Embodiments of the present invention provide systems and methods forreal-time/online interpretation/processing of data associated with ahydrocarbon related procedure to provide for real-timeautomation/control of the procedure. In an embodiment of the presentinvention the data is segmented and the segments/changepoints betweensegments are analyzed so that the data can be processed and provide forthe operation/control of the hydrocarbon related procedure.

In one embodiment, a method for automating a process in the hydrocarbonindustry is provided, the method comprising:

-   -   receiving a stream of input data from the at least one sensor;    -   upon receiving a new data item from the input data stream:        postulating that the data stream is segmented according to a        plurality of possible segmentations each comprising a plurality        of segments divided by changepoints each changepoint indicative        of a change in operating condition;    -   evaluating each segmentation by: fitting the input stream data        corresponding to each segment in the segmentation to a model        corresponding to the each segment in the segmentation; and        evaluating the segmentations by determining how well the models        for the segments of each segmentation fit the input data        corresponding to each segment of each segmentation; and    -   using at least one of the segmentations and the models        corresponding to the segments of the at least one of the        segmentations as input to a control program controlling at least        one parameter of the process in the hydrocarbon industry.

In another embodiment, a system for automating a process in thehydrocarbon industry is provided, the system comprising:

-   -   a processor configured in use to receiving a stream of input        data from at least one sensor related to the hydrocarbon        process;    -   software installed on the processor configured to postulating        that the data stream is segmented according to a plurality of        possible segmentations each comprising a plurality of segments        divided by changepoints each changepoint indicative of a change        in operating condition upon receiving a new data item from the        input data stream and to evaluate each segmentation by fitting        the input stream data corresponding to each segment in the        segmentation to a model corresponding to the each segment in the        segmentation; and evaluating the segmentations by determining        how well the models for the segments of each segmentation fit        the input data corresponding to each segment of each        segmentation; and    -   an output on the processor for communing using at least one of        the segmentations and the models corresponding to the segments        of the at least one of the segmentations as input to a control        program controlling at least one parameter of the process in the        hydrocarbon industry or to a display for use by a human        operator.    -   In one aspect, the hydrocarbon related industry is drilling and        a method of operating an automated drilling apparatus is        provided, the method comprising:    -   receiving a measurement indicative of depth-of-cut;    -   receiving weight-on-bit and drill-bit rotational speed        measurements;    -   determining a functional relationship between rate of        penetration and weight-on-bit;    -   from the functional relationship between depth-of-cut and,        weight-on-bit, determine a second functional relationship        defining rate-of-penetration as a function of drill-bit        rotational speed and weight-on-bit;    -   determine operating constraints defining a safe operating        envelope as a function of drill-bit rotational speed and        weight-on-bit;    -   determine the rotational speed and weight-in-bit parameters that        provide the optimal rate-of-penetration location within the safe        operating envelope; and    -   suggest a combination of drill-bit rotational speed and        weight-on-bit moving to move the drill-bit rotational speed and        weight-on-bit towards the rotational speed and weight-on-bit        parameters for the optimal rate-of-penetration location.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure is described in conjunction with the appendedfigures.

FIG. 1 is a schematic diagram illustrating a drilling system includingan online automation/control system, in accordance with an embodiment ofthe present invention.

FIG. 2 shows detail of a processor for processing data to automatehydrocarbon processes, for example, oilfield drilling processes as shownin FIG. 1, according to one embodiment of the present invention.

FIG. 3 is a graph illustrating changes in volume of a mud pit employedin a drilling operation including two distinct changes in volumeindicative of a change in operating condition during a wellbore drillingprocess, which change may be used in a processor for processing data toautomate hydrocarbon processes according to one embodiment of thepresent invention.

FIG. 4, which comprises FIGS. 4 a-d, is a set of graphs illustratinginclination and azimuth measurements obtained during a portion of adirectional drilling operation which change may be used in a processorfor processing data to automate hydrocarbon processes according to oneembodiment of the present invention.

FIG. 5 is a three-dimensional graph illustrating differences in thelinear response in a drill bit model, the drill bit comprisingpolycrystalline diamond compact cutters (hereinafter a “PDC bit”), fortwo different lithologies which change may be used in a processor forprocessing data to automate hydrocarbon processes according to oneembodiment of the present invention.

FIG. 6 is a flow-diagram illustrating an embodiment of the presentinvention for obtaining segmentations of data streams that may includechangepoints.

FIG. 7 is an illustration of a tree data structure showing four-levelsof data modeling corresponding to four data points and weightsassociated with the various segmentations illustrated therein, accordingto one embodiment of the present invention.

FIG. 8 is a block diagram of a software architecture for one embodimentof the present invention fir using a changepoint detector describedherein in conjunction with a process control program.

FIG. 9, which comprises FIGS. 9 a-b, is a set of graphs illustratingpossible segmentations for the inclination and azimuth measurements ofFIG. 4, according to one embodiment of the present invention.

FIG. 10, which comprises FIGS. 10 a-c, is a set of graphs illustratingthe output calculated by the changepoint detector for determining theprobability of a kick from the data stream shown in FIG. 3, according toone embodiment of the present invention.

FIG. 11 is a flow-chart illustrating the operation of the changepointdetector to determine the probability of a ramp having a value greaterthan a given threshold, according to one embodiment of the presentinvention.

FIG. 12 is a data-flow illustration showing the output of thechangepoint detector acting as an input to a Bayesian Belief Network(BBN) to use that output in conjunction with a change in rig stateoutput to draw an inference as to whether a kick has occurred, accordingto one embodiment of the present invention.

FIG. 13 is a graph illustrating the relationship betweenrate-of-penetration (ROP) as a function of weight-on-bit (WOB) anddrill-bit-rotational speed (RPM), which relationship may be used in aprocessor for processing data to automate hydrocarbon processesaccording to one embodiment of the present invention.

FIG. 14 is the graph of FIG. 13 having drilling process constraintssuper-imposed thereon to define a safe operating window, which windowmay be analyzed/used in a processor for processing data to automatehydrocarbon processes according to one embodiment of the presentinvention.

FIG. 15 is a screen shot of a graphic user's interface displayingdrilling data collected during a drilling operation, straight linemodels corresponding to a preferred segmentation, the safe operatingwindow corresponding to the current segmentations, current drillingparameters used, and recommended parameters to optimize rate ofpenetration, according to one embodiment of the present invention.

FIG. 16 is a flow-chart illustrating the operation of the changepointdetector to determine recommended parameters in an ROP optimizer,according to one embodiment of the present invention.

FIG. 17 is a three-dimensional graph illustrating azimuth andinclination of a wellbore through a three-dimensional space, which datamay be used in a processor for processing data to automate hydrocarbonprocesses according to one embodiment of the present invention.

FIG. 18 is a flow-chart illustrating the use of a changepoint detectorin determining real-time estimates for dogleg severity and toolface fromazimuth and inclination data collected during a drilling operation,according to one embodiment of the present invention.

In the appended figures, similar components and/or features may have thesame reference label. Further, various components of the same type maybe distinguished by following the reference label by a dash and a secondlabel that distinguishes among the similar components or by appendingthe reference label with a letter. If only the first reference label isused in the specification, the description is applicable to any one ofthe similar components having the same first reference labelirrespective of the second reference label or appended letter.

DETAILED DESCRIPTION

In the following detailed description, reference is made to theaccompanying drawings that show, by way of illustration, specificembodiments in which the invention may be practiced. These embodimentsare described in sufficient detail to enable those skilled in the art topractice the invention. It is to be understood that the variousembodiments of the invention, although different, are not necessarilymutually exclusive. For example, a particular feature, structure, orcharacteristic described herein in connection with one embodiment may beimplemented within other embodiments without departing from the spiritand scope of the invention. In addition, it is to be understood that thelocation or arrangement of individual elements within each disclosedembodiment may be modified without departing from the spirit and scopeof the invention. The following detailed description is, therefore, notto be taken in a limiting sense, and the scope of the present inventionis defined only by the appended claims, appropriately interpreted, alongwith the full range of equivalents to which the claims are entitled. Inthe drawings, like numerals refer to the same or similar functionalitythroughout the several views.

It should also be noted that in the description provided herein,computer software is described as performing certain tasks. For example,we may state that a changepoint detector module performs a segmentationof a data stream by following a described methodology. That, of course,is intended to mean that a central processing unit executing theinstructions included in the changepoint detector (or equivalentinstructions) would perform the segmentation by appropriatelymanipulating data and data structures stored in memory and secondarystorage devices controlled by the central processing unit. Furthermore,while the description provides for embodiments with particulararrangements of computer processors and peripheral devices, there isvirtually no limit to alternative arrangements, for example, multipleprocessors, distributed computing environments, web-based computing. Allsuch alternatives are to be considered equivalent to those described andclaimed herein.

It should also be noted that in the development of any such actualembodiment, numerous decisions specific to circumstance must be made toachieve the developer's specific goals, such as compliance withsystem-related and business-related constraints, which will vary fromone implementation to another. Moreover, it will be appreciated thatsuch a development effort might be complex and time-consuming but wouldnevertheless be a routine undertaking for those of ordinary skill in theart having the benefit of this disclosure.

In this disclosure, the term “storage medium” may represent one or moredevices for storing data, including read only memory (ROM), randomaccess memory (RAM), magnetic RAM, core memory, magnetic disk storagemediums, optical storage mediums, flash memory devices and/or othermachine readable mediums for storing information. The term“computer-readable medium” includes, but is not limited to portable orfixed storage devices, optical storage devices, wireless channels andvarious other mediums capable of storing, containing or carryinginstruction(s) and/or data.

FIG. 1 shows a drilling system 10 using changepoint detection in thecontrol of the drilling apparatus, according to one embodiment of thepresent invention. As depicted, a drill string 58 is shown within aborehole 46. The borehole 46 is located in the earth 40 having a surface42. The borehole 46 is being cut by the action of a drill bit 54. Thedrill bit 54 is disposed at the far end of the bottomhole assembly 56that is itself attached to and forms the lower portion of the drillstring 58.

The bottombole assembly 56 contains a number of devices includingvarious subassemblies. According to an embodiment of the presentinvention, measurement-while-drilling (MWD) subassemblies may beincluded in subassemblies 62. Examples of typical MWD measurementsinclude direction, inclination, survey data, downhole pressure (insidethe drill pipe, and outside or annular pressure), resistivity, density,and porosity. The subassemblies 62 may also include is a subassembly formeasuring torque and weight on bit.

The subassemblies 62 may generate signals related to the measurementsmade by the subassemblies 62. The signals from the subassemblies 62 maybe processed in processor 66. After processing, the information fromprocessor 66 may be communicated to communication assembly 64. Thecommunication assembly 64 may comprise a pulser, a signal processor, anacoustic processor and/or the like. The communication assembly 64converts the information from processor 66 into signals that may becommunicated as pressure pulses in the drilling fluid, as signals forcommunication through an optic fibre, a wire and/or the like, or signalsfor wireless or acoustic communication and/or the like. Embodiments ofthe present invention may be used with any type of sensor associatedwith the hydrocarbon industry and with any type of telemetry system usedwith the sensor for communicating data from the sensor to the onlinechangepoint detector, according to one embodiment of the presentinvention.

The subassemblies in the bottomhole assembly 56 can also include aturbine or motor for providing power for rotating and steering drill bit54. In different embodiments, other telemetry systems, such as wiredpipe, fiber optic systems, acoustic systems, wireless communicationsystems and/or the like may be used to transmit data to the surfacesystem.

The drilling rig 12 includes a derrick 68 and hoisting system, arotating system, and a mud circulation system. The hoisting system whichsuspends the drill string 58, includes draw works 70, fast line 71,crown block 75, drilling line 79, traveling block and hook 72, swivel74, and deadline 77. The rotating system includes kelly 76, rotary table88, and engines (not shown). The rotating system imparts a rotationalforce on the drill string 58 as is well known in the art. Although asystem with a kelly and rotary table is shown in FIG. 1, those of skillin the art will recognize that the present invention is also applicableto top drive drilling arrangements. Although the drilling system isshown in FIG. 1 as being on land, those of skill in the art willrecognize that the present invention is equally applicable to marineenvironments.

The mud circulation system pumps drilling fluid down the central openingin the drill string. The drilling fluid is often called mud, and it istypically a mixture of water or diesel fuel, special clays, and otherchemicals. The drilling mud is stored in mud pit 78. The drilling mud isdrawn in to mud pumps (not shown), which pump the mud through stand pipe86 and into the kelly 76 through swivel 74 which contains a rotatingseal.

The mud passes through drill string 58 and through drill bit 54. As theteeth of the drill bit grind and gouges the earth formation intocuttings the mud is ejected out of openings or nozzles in the bit withgreat speed and pressure. These jets of mud lift the cuttings off thebottom of the hole and away from the bit 54, and up towards the surfacein the annular space between drill string 58 and the wall of borehole46.

At the surface the mud and cuttings leave the well through a side outletin blowout preventer 99 and through mud return line (not shown). Blowoutpreventer 99 comprises a pressure control device and a rotary seal. Themud return line feeds the mud into separator (not shown) which separatesthe mud from the cuttings. From the separator, the mud is returned tomud pit 78 for storage and re-use.

Various sensors are placed on the drilling rig 10 to take measurement ofthe drilling equipment. In particular hookload is measured by hookloadsensor 94 mounted on deadline 77, block position and the related blockvelocity are measured by block sensor 95 which is part of the draw works70. Surface torque is measured by a sensor on the rotary table 88.Standpipe pressure is measured by pressure sensor 92, located onstandpipe 86. Additional sensors may be used to detect whether the drillbit 54 is on bottom. Signals from these measurements are communicated toa central surface processor 96. In addition, mud pulses traveling up thedrillstring are detected by pressure sensor 92.

Pressure sensor 92 comprises a transducer that converts the mud pressureinto electronic signals. The pressure sensor 92 is connected to surfaceprocessor 96 that converts the signal from the pressure signal intodigital form, stores and demodulates the digital signal into useable MWDdata. According to various embodiments described above, surfaceprocessor 96 is programmed to automatically detect the most likely rigstate based on the various input channels described. Processor 96 isalso programmed to carry out the automated event detection as describedabove. Processor 96 preferably transmits the rig state and/or eventdetection information to user interface system 97 which is designed towarn the drilling personnel of undesirable events and/or suggestactivity to the drilling personnel to avoid undesirable events, asdescribed above. In other embodiments, interface system 97 may output astatus of drilling operations to a user, which may be a softwareapplication, a processor and/or the like, and the user may manage thedrilling operations using the status.

Processor 96 may be further programmed, as described below, to interpretthe data collected by the various sensors provided to provide aninterpretation in terms of activities that may have occurred inproducing the collected data. Such interpretation may be used tounderstand the activities of a driller, to automate particular tasks ofa driller, to provide suggested course of action such as parametersetting, and to provide training for drillers.

In the hydrocarbon industry it is often desirable to automate,semi-automate and/or the like operations to remove, mitigate humanerror, to increase speed and/or efficiency, allow for remote operationor control, lessen communication obstacles and/or the like. Moreover, inthe hydrocarbon industry sensors are commonly deployed to gather data toprovide for monitoring and control of the systems related to hydrocarboncapture and/or the like.

In the process of drilling a borehole a plurality of sensors are used tomonitor the drilling process—including the functioning of the drillingcomponents, the state of drilling fluids or the like in the borehole,the drilling trajectory and/or the like—characterize the earth formationaround or in front of the location being drilled, monitor properties ofa hydrocarbon reservoir or water reservoir proximal to the borehole ordrilling location and/or the like.

To analyze the multitude of data that may be sensed during the drillingprocess, averaging or the like has often been used to make statisticalassumptions from the data. Such averaging analysis may involve samplingsensed data periodically and then statistically analyzing the periodicdata, which is in effect a looking backwards type analysis. Averagingmay also involve taking frequent or continuous data and makingassessments from averages/trends in the data.

Most analysis of data captured in the hydrocarbon industry is movingwindow analysis, i.e., a window of data is analyzed using the sameassumptions/as a whole without consideration as to whether a change hasoccurred requiring separate analysis of different portions of the windowof data. If small data windows are selected to try and avoid/mitigatethe effect of changes on the data being analyzed, the small windowsoften give rise to large amounts of “noise” in the data. To avoid themoving window problem, Kalman filters have been used, however suchfilters can only smooth out effects of changes, especially abruptchanges, on the data, and may provide for incorrect analysis ofessentially steady state data in which changes are not occurring. Inembodiments of the present invention, real-time analysis of the data isprovided by identifying and/or processing changepoints in the data.

FIG. 2 shows further detail of processor 96, according to preferredembodiments of the invention. Processor 96 preferably consists of one ormore central processing units 350, main memory 352, communications orI/O modules 354, graphics devices 356, a floating point accelerator 358,and mass storage such as tapes and discs 360. It should be noted thatwhile processor 96 is illustrated as being part of the drill siteapparatus, it may also be located, for example, in an explorationcompany data center or headquarters. It should be noted that manyalternative architectures for processor 96 are possible and that thefunctionality described herein may be distributed over multipleprocessors. All such alternatives are considered equivalents to thearchitecture illustrated and described here.

Data collected by various sensors in industrial processes are often verynoisy. Such noise may cause real-time human interpretation of the datanear impossible. Furthermore, calculations based on individualdatapoints may amplify the effect of the noise.

FIGS. 3 through 5 are illustrations of various examples of data that maybe encountered in the process of drilling wells in the exploration forsubterranean resources such as oil, gas, coal, and water.

FIG. 3 shows pit volume data 215 changing with time in a process ofdrilling a wellbore 46. In the process of drilling a wellbore 46, adrilling fluid called mud is pumped down the central opening in thedrill pipe and passes through nozzles in the drill bit 54. The mud thenreturns to the surface in the annular space between the drill pipe 58and the inner-wall of the borehole 46 and is returned to the mud pit 78,ready for pumping downhole again. Sensors measure the volume of mud inthe pit 78 and the volumetric flow rate of mud entering and exiting thewell. An unscheduled influx of formation fluids into the wellbore 46 iscalled a kick and is potentially dangerous. The kick may be detected byobserving that flow-out is greater than flow-in and that the pit volumehas increased.

In FIG. 3, a pit volume data signal 215 is plotted against a time axis220. The pit volume data signal 215 is measured in [m3] and illustratedon a volume axis 210. During the drilling process, a kick may beobserved in the data at around t=1300 and t=1700 time on the time axis220. The kick is identifiable in the pit volume data signal 215 as achange in the gradient of the pit volume data signal 215. It isdesirable to detect these kicks automatically and to correlate theoccurrence of kicks with other events taking place in the drillingoperation, e.g., changes in rig state.

FIG. 4, which comprises FIGS. 4 a-d, is a set of graphs illustratinginclination 401 and azimuth 403 measurements obtained during a portionof a directional drilling operation. Inclination 401 and azimuth 403measurements are useful to a driller in adjusting the drilling operationto arrive at particular target formations. The driller uses thesemeasurements to predict whether the desired target is likely to beintersected and may take corrective actions to parameters such asweight-on-bit and drilling-rotational-speed to cause the drillingtrajectory to change in the direction of the target if necessary.

As may be seen in FIG. 4 both the continuous inclination data channel401 and the continuous azimuth data channel have rather noisy data. Yetexamination of the data reveals certain trends illustrated by thesegmented straight lines superimposed on the raw data in FIGS. 4C & 4D,respectively. For example, in the inclination data 401 b, the data seemsto follow a ramp from depth ≈1.016×10⁴ to depth ≈1.027×10⁴, followed bya step to depth ≈1.0375×10⁴, and another ramp to ≈1.047×10⁴. Fordetermination of the curvature of the well (“dogleg severity”) anddirection of the curvature (“toolface”), it would be preferable to usemodels reflecting these steps and ramps than any one data point in thedata stream. Conversely, using such models would be preferable to thetraditional way of taking stationary measurements at 30 foot or 90 footintervals because calculations based models based on the steps and rampmodels of the data may be used in real-time, not require taking thedrilling operation off-bottom, and may provide dogleg severity andtoolface calculations at relatively short intervals.

FIG. 5 is yet another graphical illustration of how changes in lithologymay affect drilling operations, in this case, the bit response of a PDC(Polycrystalline diamond compact) bit in the three-dimensional spacedefined by weight-on-bit (“WOB”), depth-of-cut (“DOC”), and torque. Theexpected bit response in that space is described in Detournay, Emmanuel,Thomas et al., Drilling Response of Dragbits: Theory and Experiment,International Journal of Rock Mechanics & Mining Sciences 45 (2008):1347-1360. The bit response tends to have three phases with respect tothe WOB applied. Each phase has a relatively linear bit response.

In a first phase 501, with low WOB applied, very low depth of cut isachieved. At low WOB most of the interaction between the bit 54 and rockoccurs at the wear flats on the cutters. Neither the rock surface northe wear flat will be perfectly smooth, so as depth of cut increases therock beneath the contact area will fail and the contact area willenlarge. This continues until a critical depth of cut where the failedrock fully conforms to the geometry of the wear flats and the contactarea grows no larger. Next, a second phase 503 corresponds to anintermediate amount of WOB. In this phase 503, beyond a critical depthof cut, any increase in WOB translates into pure cutting action.

The bit incrementally behaves as a perfectly sharp bit until the cuttersare completely buried in the rock and the founder point is reached. Thethird phase 505 is similar to the first phase 501 in that little isgained from additional WOB. The response past the founder point dependson how quickly the excess WOB is applied. Applied rapidly, the uncutrock ahead of the cutters will contact with the matrix body of the bitand act in a similar manner to the wear flats in Phase I, so depth ofcut will increase slightly with increasing WOB. Applied slowly, thecuttings may become trapped between the matrix and the uncut rock, sodepth of cut may decrease with increasing WOB. Drillers prefer tooperate near the top of the second phase with the optimal depth of cutachieved without wasting additional WOB.

Depth of cut per revolution can be estimated by dividing ROP by RPM, soreal-time drilling data can be plotted in the three dimensional {WOB,bit torque and depth of cut} space as illustrated in FIG. 5. As the bitdrills into a new formation, the response will change abruptly and thepoints will fall on a new line. The plotted line 507 illustrates a modelof the bit response for a first formation corresponding to collecteddata points 509. On the other hand, data points 511 correspond to datacollected in a different formation from the data points 509. If thesecond set (511) correspond to data encountered after the first set(509), a change in formation and ancillary operating conditions may haveoccurred.

A straight line in three dimensions has four unknown parameters, twoslopes and the intersection with the x-y plane, i.e., WOB-torque planein this case. These parameters could be estimated with a least squaresfit to a temporal or spatial sliding window, e.g., last five minutes orlast ten feet of data, but this would provide very poor fits in thevicinity of formation boundaries. For example, in FIG. 5, plotting astraight line through both the points of the first set (509) and pointsof the second set (511) would yield bizarre model parameters.

The PDC bit models have successfully been applied in the field by manualinspection of the data and breaking it up into homogeneous segments,e.g., in FIG. 5, a straight line is fitted to the data points 509 onlyand a second straight line (not shown) may be fitted to the data points511 only, thereby avoiding the cross-class polluted estimates producedby a moving window. While in a simplified example as illustrated in FIG.5 it is possible to visually see that the data points 511 and the datapoints 509 lie/occur on different lines, with real world data, this is alabour intensive process that hitherto has prevented application of thePDC bit model in controlling drilling systems/procedures.

Consider now again FIGS. 4A & 4B. As discussed hereinabove, the data maybe segmented into three different segments and each segment havingassociated therewith a model particularly useful for modeling the datain that segment. In a preferred embodiment of the invention, the data ismodeled using either ramp or step functions, for example, using theleast squares algorithm, and these models are evaluated using BayesianModel Selection. Bayesian Model Selection is discussed in detail inDeviderjit Sivia and John Skilling, Data Analysis: A Bayesian Tutorial(OUP Oxford, 2 ed. 2006), the entire contents of which is incorporatedherein by reference. Thus, for each segment of each segmentation, amodel that is either a ramp or a step is assigned and the correspondingsegmentations are assigned a weight indicative of how well thesegmentation and associated models conform to the data stream ascompared to other segmentations.

In embodiments of the present invention, online data analysis may beprovided by treating incoming data as being composed of segments betweenwhich are changepoints. The changepoints may be identified by the dataanalysis to provide for detection in changes in the automated industrialprocess. In certain aspects, a plurality of sensors or the like mayprovide a plurality of data channels that may be segmented intohomogeneous segments and data fusion may be used to cross-correlate,compare, contrast or the like, changepoints in the incoming data toprovide for management of the automated industrial procedure.

In an embodiment of the present invention, the data may be analyzed inreal-time to provide for real-time detection, rather than retrospective,detection of the changepoint. This real-time detection of thechangepoint may be referred to as online analysis/detection. In anembodiment of the present invention, the data from one or more sensorsmay be fitted to an appropriate model and from analysis of the incomingdata with regard to the model changepoints may be identified. The modelmay be derived theoretically, from experimentation, from analysis ofprevious operations and/or the like.

As such, in an embodiment of the present invention, data from anautomated industrial process may be analyzed in an online process usingchangepoint modeling. The changepoint models divide a heterogeneoussignal, in an embodiment of the present invention the signal being datafrom one or more sources associated with the hydrocarbon relatedprocess, into a sequence of homogeneous segments. The discontinuitiesbetween segments are referred to as changepoints.

Merely by way of example, an online changepoint detector in accordancewith an embodiment of the present invention, may model the data in eachhomogeneous segment as a linear model, such as a ramp or step, withadditive Gaussian noise. Such models are useful when the data has alinear relationship to the index. In alternative embodiments, morecomplex models may be employed, e.g., exponential, polynomial andtrigonometric functions. As each new sample (set of data) is received,the algorithm outputs an updated estimate of the parameters of theunderlying signal, e.g., the mean height of steps, the mean gradient oframps and the mean offset of ramps, and additionally the parameters ofthe additive noise (for zero-mean Gaussian noise, the parameter is thestandard deviation or the variance, but for more general noisedistributions other parameters such as skewness or kurtosis may also beestimated).

If so chosen, a changepoint may be designated where the noise parametersare found to have changed. In some embodiments of the present invention,the tails of a distribution are may be considered in the analysis, aswhen analyzing the risk of an event occurring the tails of thedistribution may provide a better analytical tool than the mean of thedistribution. In an embodiment of the present invention, the changepointdetector may be used to determine a probability that theheight/gradient/offset of the sample is above/below a specificthreshold.

A basic output of the changepoint detector may be a collection of listsof changepoint times and a probability for each list. The most probablelist is thus the most probable segmentation of the data according to thechoice of models: G1, . . . , Gj.

The segmentation of the signal may be described using a tree structure(see FIG. 7) and the algorithm may be considered as a search of thistree. At time 0 (before any data has arrived) the tree consists of asingle root node, R. At time 1 the root node spawns J leaves, one leaffor each of the J segment models—the first leaf represents thehypothesis that the first data point is modeled with G₁, the second leafhypothesises is G₂, etc. At subsequent times, the tree grows by eachleaf node spawning J+1 leaves, one for each model and an extra onerepresented by 0, which indicates that the data point at thecorresponding time belongs to the same model segment as its parent. Forexample, if G₁ were a step model and G₂ were a ramp, a path through thetree from the root to a leaf node at time 9 might be:

R 100000200

where this would indicate that the first six samples were generated by astep and that the remaining four samples were generated by a ramp.

Over time the tree grows and it is searched using a collection ofparticles each occupying a distinct leaf node. The number of particlesmay be chosen by the user/operator and around 20-100 is may besufficient, however other amounts of particles may be used in differentaspects of the present invention. Associated with a particle is aweight, which can be interpreted as the probability that thesegmentation indicated by the path from the particle to the root (as inthe example above) is the correct segmentation. The objective of thealgorithm is to concentrate the particles on leaves that mean theparticle weights will be large.

FIG. 6 is a flow-diagram illustrating an embodiment of the presentinvention for obtaining segmentations of data streams that may includechangepoints. The segmentation process for determining changepoints andassociated models successively builds a tree data structure, an exampleof which is illustrated in FIG. 7, wherein each node in the treerepresents different segmentations of the data. The tree is alsoperiodically pruned to discard low-probability segmentations, i.e.,segmentations that have a poor fit to the data.

In a first step, the segmentations are initialized by establishing aroot node R, step 701. Next a data point is received from one or moreinput streams, step 703. In response the segmentation process spawnschild segmentations, step 705, that reflect three differentalternatives, namely, a continuation of the previous segment, a newsegment with a first model, or a new segment with a second model (whilewe are in this example describing an embodiment with two models, rampand step, in alternative embodiments, additional models may beincluded). In an embodiment of the present invention, illustrated anddescribed herein, the alternative models are ramp and step functions. Asthe root node does not represent any model, the first generation in thetree, reflecting the first data point, must start a new segment which iseither a ramp, which is represented in the tree as 1, or a step, whichis represented in the tree as 2.

In the example given above, the particle R 100000200 would produce threenew child nodes with corresponding particles:

R 1000002000

R 1000002001

R 1000002002

The first of which indicates a continuation of the step segment thatbegins with the 7th data point, the second, a new ramp, and the third, anew step.

Models are then created by fitting the data in the new segments to thedesignated models for the segments and models corresponding to existingsegments are refit, step 706. For example, if a new ramp segment is tobe created for a new child particle, the data in the segment is fit tothat ramp. Naturally, when a new segment is created, the correspondingmodel that is assigned is merely a function that puts the model valuethrough the new data point. However, for existing segments in which thesegment encompasses a plurality of data points, the model parameters,e.g., the parameters defining the gradient and offset of a ramp, arere-evaluated. Some form of linear regression technique may be used todetermine the linear function to be used to model the data in thesegment as a ramp or step.

The segmentations produced are next evaluated, step 707, using BayesianModel Selection or the like to calculate weights indicative of how gooda fit each segmentation is for the underlying data.

After the segmentations, creation of model functions, and correspondingmodels have been evaluated, i.e., having had weights assigned thereto,the tree is pruned by removing some particles from future considerationand to keep the particle population size manageable, step 709. Theweights of the remaining particles are normalized, step 711.

Having evaluated the segmentations of the input data stream, thesegmentations and corresponding models may be used in a process controlprogram or in a further data analysis program, step 713. The use of thesegmentations and corresponding models may take several forms. Forexample, the remaining segmentations may each be used to evaluate theinput data in the calculation of a quantity used to compare against athreshold value for the purpose of alerting of a condition to which somecorrective action should be taken. In such a scenario, a weightedaverage (weighted by the weights associated with each segmentation) maybe computed to determine the probability that the condition has or hasnot occurred. This probability may either be used to trigger an actionor suggest an action, or as input into further condition analysisprograms.

FIG. 8 is a block diagram illustrating a possible software architectureusing changepoint detection as described herein. A changepoint detectormodule 901 and a process control program 903 may both be stored on themass storage devices 360 of computer system 96 used to receive andanalyze sensor data obtained from a drilling operation, and for controlof the drilling operation. The changepoint detector module 901 containscomputer instructions processable by the CPU 350 to provide calculationsas described herein, for example, the process flow set forth in FIG. 6.These instructions cause the CPU 350 to receive data from a data stream905 from one of the various sensors on the drilling rig, or otherindustrial process.

The input data is processed by the CPU 350 according to instructions ofa segmentation module 907 to produce segmentations 909 of the data asdescribed herein. These segmentations contain segments defined byintervals of an index of the data stream, and models associated withthose segments. The segments are fed into a calculation module toprovide a result from the changepoint detector 901 that in turn is aninput to the process control program 903. The result may be aprobability of an event having occurred or some other interpretation ofthe input data (e.g., toolface or dogleg severity), or even arecommended action (e.g., suggested change in drillbit rotational speedor weight on bit to obtain better rate of penetration).

A more detailed view of FIG. 7, which is a graphical depiction of thesegmentation tree 801 and weights 803 associated with the activeparticles after four time indexes, is now provided. As noted above, toarrive at a segmentation, the changepoint detector 901 uses a system ofparticles and weights. From, Time 0 (which is represented by the rootnode R) to Time 1, two particles (“1” and “2”) are spawned (Step 705);the first one (“1”) representing a step and the second (“2”)representing a ramp. At Time 2 (and each subsequent time index), each ofthe currently active particles spawns three particles, the firstrepresenting no change (“0”), the second representing a step (“1”) andthe third representing a ramp (“2”), thus producing the particles 10,11, 12, 20, 21, and 22. This continues for each time index and at Time 4the tree has grown to 54 particles. For each active particle, i.e., aparticle that was spawned at the latest index and that has not beenremoved through the pruning step (Step 709), a weight is determined(Step 707 and Step 711). These weights are illustrated graphically inFIG. 7 in the weight bar chart 803. The weights are used to prune thetree 801 by removing the lowest weight particles when the number ofparticles exceed a preset maximum.

As noted in the discussion of FIG. 6, when the weights for the remainingactive particles have been determined and normalized, the resultingsegmentations are used in conjunction with a control program 713.

Consider by way of example again the inclination 401 a and azimuth 403 ainput streams from FIG. 4. FIG. 9, which comprises FIGS. 9 a-b, is a setof graphs illustrating changepoints identified by the changepointdetector 901 and the associated models. For example, in the inclinationstream 401 b, the changepoint detector 901 identifies changepoints 405and 407, in addition to changepoints at the start and end of the dataset. Similarly, in the azimuth data stream 403 b, the changepointdetector 901 identifies changepoints 409 and 411. For the inclinationstream, the changepoint detector 901 has fit a ramp for the segment upto the first changepoint 405, followed by a step up to the secondchangepoint 407, and finally a ramp for the data following the secondchangepoint 407. On the other hand, for the azimuth datastream 403 b,the changepoint detector 901 has fit three successive ramps, each havingdifferent gradient.

As the above paragraphs illustrate, there are many processes relating tothe drilling of a hydrocarbon well or operation of any other hydrocarbonrelated procedure in which data that is indicative of operatingenvironment is subject to difficult interpretation due to noise or otherfactors, yet where that data and changes in the operating environmentthat the data reflects may have significant effect on how an operator ofthe drilling of the hydrocarbon well or operation of the hydrocarbonrelated procedure would set parameters for optimal process performanceor where the such data, if modeled accurately, may be very useful inautomation of aspects of the creation/operation of the hydrocarbon well.

We now turn to three examples of the use of the changepoint detector 901in conjunction with a control program 903.

In a first example, the changepoint detector 901 is used to determinekicks encountered in a drilling operation. In the process of drilling awellbore, a drilling fluid called mud is pumped down the central openingin the drill pipe and passes through nozzles in the drill bit. The mudthen returns to the surface in the annular space between the drill pipeand borehole wall and is returned to the mud pit, ready for pumpingdownhole again. Sensors measure the volume of mud in the pit and thevolumetric flow rate of mud entering and exiting the well. Anunscheduled influx of formation fluids into the wellbore is called akick and is potentially dangerous. The kick may be detected by observingthat flow-out is greater than flow-in and that the pit volume hasincreased.

FIG. 3 is a graphical depiction of pit volume data changing with time ina process of drilling a wellbore. In FIG. 3, a pit volume data signal215 is plotted against a time axis 220. The pit volume data signal 215is measured in cubic meters (m³) and illustrated on a volume axis 210.The pit volume signal is indicative of kicks at two locations, at aroundt=1300 and t=1700. For the sake of discussion, suppose that during thedrilling process, a kick was manually detected for the second of theseat around the t=1700 time on the time, axis 220 and that the increase inpit volume at t=1300 is due to a connection of drilling pipe. The kickis identifiable in the pit volume data signal 215 as a change in thegradient of the pit volume data signal 215.

FIG. 10, which comprises FIGS. 10 a-c, is a set of graphs illustratingthe application of the changepoint detector 901 to the pit-volume dataof FIG. 3 (for the convenience of the reader, FIG. 3 is replicated inFIG. 10 as FIG. 10A), in accordance with an embodiment of the invention.FIG. 10B is a graphical illustration of the output from the changepointdetector 901. The changepoint detector 901 processes homogeneoussegments of the pit volume data 215 from FIG. 10A. Using thesehomogeneous segments the changepoint detector 901 produces an outputsignal indicative of the probability 225 that a ramp in the pit volumedata 215 has a gradient greater than 0.001 m³/s. The probability 225 isplotted against the time axis 220 and a probability axis 227 thatprovides for a zero to unity probability.

FIG. 11 is a flow-chart illustrating the operation of the changepointdetector 901 to determine the probability of a ramp having a valuegreater than a given threshold. Applying the method described inconjunction with FIGS. 6 and 7, the changepoint detector 901 determinespossible segmentations and assigns weights to these segmentations, step101. In the example of FIG. 10, step 101 would have arrived at a numberof segmentations, likely including segmentations that indicate stepsfrom t=800 to t=1280 and a ramp from t=1280 to t=1300. Because such asegmentation would have a good fit to the data, that segmentation wouldhave a very high weight.

Next the calculation module 911 uses the segmentations to calculate adesired probability value, step 103. In the present example, thatprobability is the probability of the ramp of the pit volume dataexceeds a given threshold, namely, for the purposes of the example,0.001 m³/s. That result is obtained by calculating the gradient from themodels corresponding to each active segmentation, step 105, andcomputing a weighted average over those results based on the weightassociated with each segmentation. If one of the possible segmentationsunder consideration represented a continuation of the model from t=800which has a very low ramp or even a step, once the volume data startsincreasing at t=1300 (and similarly at t=1700) that model would be apoor fit and have a very low weight associated with it. Therefore, att=1300, the weighted average calculation would give the segmentationthat includes a ramp beginning at t=1280 a very large weight and thatsegmentation would have a high influence on the weighted averagecalculation and the final result.

In FIG. 10B, the probability 225 approaches unity around the time thekick may be manually identified in the pit volume data 215 in FIG. 10A.As such, the changepoint detector of the present invention may providefor using probabilistic gradient analysis of data retrieved during adrilling process to determine in real-time the occurrence of a kick orthe like.

FIG. 10C illustrates flow-in and flow-out data corresponding to the pitvolume data of FIG. 10A for the drilling process. As illustrated,flow-in data 230 and flow-out-data 233 for the wellbore drillingoperation is plotted against the time axis 220. The flow-in/flow-outdata is not used in the changepoint detection method illustrated in FIG.10B. However, it may be seen that there is a fluctuation in the data attime, t=1700, that corresponds to the kick that the changepoint detectorof FIG. 10B seeks to detect.

The changepoint detector of FIG. 10B may have the followingcharacteristics:

(a) The probability analysis for the changepoint detector may alsoapproaches unity when a connection of a drilling pipe is made at timet=1300.

(b) When the circulation of the system is not at steady-state, the pitvolume may be affected by flowline delays and wellbore ballooning.

(c) Thresholding of the gradient of pit volumes may be somewhatarbitrary. To analyze the automated drilling process in real-time,shallow gradients of the received data over long durations may be asdeterminative in the analysis process as steep gradients received overshort durations. As such, since the height of the ramp is the volume ofthe influx, it may be preferable to threshold, base real-time analysis,upon this statistic.

(d) The kick may also be seen in the flow data associated with thedrilling process, shown in FIG. 10C. However, the gradient algorithmdoes not use this additional data.

To take the additional information available from drilling process intoaccount, the output from the changepoint detector may be fed intoadditional analysis software for fusing the changepoint detector outputwith such additional information. For example, the changepoint detectoroutput may be one input to a Bayesian Belief Network used to combinethat output with detection of changes in rig state, i.e., the currentstate of the drilling rig.

FIG. 12 is a flow-type illustration of changepoint detector foranalyzing an automated drilling process in which flow-out minus flow-in,called delta flow, and pit volume are probabilistically analyzed toidentify changepoints, in accordance with an embodiment of the presentinvention. As depicted in FIG. 12, pit volume data 305 and delta flowdata 310 are detected during an automated drilling process. In anembodiment of the present invention, changepoint detectors 901 a and 901b may be applied to both the pit volume data 305 and the delta flow data310.

As described previously, for example in conjunction with FIGS. 6 and 7,in an embodiment of the present invention, the pit volume data 305 anddelta flow data 310 may be broken down into homogeneous segments inreal-time. A first changepoint detector 901 a associated with the pitvolume data 305 may analyze the pit volume data 305 and from comparisonswith previous segments may detect when one of the homogeneous segmentsof the incoming data does not have a positive gradient, e.g., thechangepoint detector 901 a may detect a step model or a ramp withnegative gradient. Similarly, a second changepoint detector 901 bassociated with the delta flow data 310 may analyze the pit volume data305 and from comparisons with previous segments may detect when one ofthe homogeneous segments of the incoming data does not have a positivegradient, e.g., the detector 901 b may detect a step model or a rampwith negative gradient.

In accordance with some embodiments of the present invention, each ofthe plurality of the changepoint detectors 901 may process for thesegment(s) with positive gradient the probability that the influx volumeis greater than a threshold volume T. In FIG. 12 the volume is an areaunder the delta flow ramp(s) 323 and a vertical height 326 of the pitvolume ramp(s). Each changepoint detector 901 may calculate the overallprobability p(vol>T) as a weighted sum of the probabilities from all thesegmentation hypotheses it has under consideration.

The two continuous probabilities p(vol>T) 121 a and 121 b may be enteredinto a BBN 123, specifically into a Pit Gain node 131 and an Excess Flownode 133. In an embodiment of the present invention, a condition WellFlowing node 135 may describe the conditional probabilities of anexistence of more fluid exiting the wellbore being drilled in theautomatic drilling process than entering the wellbore. Such a conditionoccurring in the drilling process may cause PitGain and ExcessFlowsignatures in the surface channels. The Well Flowing node output 135 maybe a result of a change in the drilling process, i.e., a recent changein rig state, node 137. For example, the circulation of fluid in thewellbore may not be at a steady-state due, for example to switchingpumps on/off or moving the drilling pipe during the drilling process.Deliberate changes in the drilling process, such as changing pump rates,moving the drill pipe, changing drilling speed and/or the like may bereferred as rig states. Detection of change of rig state is described inU.S. Pat. No. 7,128,167, System and Method for Rig State Detection, toJonathan Dunlop, et al., issued Oct. 31, 2006.

In an embodiment of the present invention, a rig state detector 345 maybe coupled with the drilling process system. The rig state detector 345may receive data from the components of the drilling system, thewellbore, the surrounding formation and/or the like and may input aprobability of recent change in rig state 137 to the changepointdetectors. In this way, the changepoint detectors 901 may determine whena detected changepoint results from the recent change in rig state 137.For example, in FIG. 12, the changepoint detector may identify when theWell Flowing node 135 may be caused by the recent change in rig state137.

As depicted in FIG. 12, another cause of well flowing 135 may be a kick353. In an embodiment of the present invention, the changepoint detectormay analyze the pit volume data 305 and the delta flow data 310 todetermine occurrence of a changepoint to determine whether the conditionof the well flowing 135 has occurred and may use the probability of arecent change in rig state 350 to determine an existence of the kick353.

In an embodiment of the present invention, the online determination ofthe kick 353 may cause an output of an alarm for manual intervention inthe drilling process, may cause a control processor to change theautomated drilling process and/or the like, for example, the detectionof a kick 353 may be reported on a control console connected to thecentral surface processor 96. In certain aspects, data concerning thewellbore, the formation surrounding the wellbore, such as permeableformation in open hole with pore pressure greater than ECD may be inputto the changepoint detector and may allow for greater accuracy indetection of the kick 353. In some aspects of the present invention, iffluid is being transferred into the active mud pit 78, data concerningsuch a transfer or addition 356 may be provided to the changepointdetector as it may cause the Pit Gain 330 but not Excess Flow 335. Insuch aspects of the present invention, by inputting the transfer oraddition 356 to the changepoint detector(s), mistaken detection of theKick 353 may be avoided.

In FIG. 12, the changepoint detectors 901 are provided raw data and mayuse Bayesian probability analysis or the like to model the data anddetermine an existence of a changepoint. The segmenting of the raw datamay provide for flexible modeling of the data within individualsegments, e.g., as linear, quadratic, or other regression functions.

If a kick is suspected a flow check is performed, whereby the mud pumpsare stopped and any subsequent flow-out can definitively confirm a kick.To control a kick, the drillstring is lifted until a tool joint is justabove the drill floor and then valves called blowout preventers are thenused to shut-in the well. The influx is then circulated to the surfacesafely before drilling can resume. Small influxes are generally quickerand more simple to control, so early detection and shut-in is extremelyimportant. Automating the above process should consistently minimize thenon-productive time.

Other processes the present invention may be applied to in thehydrocarbon industry include: stuck pipe, lost circulation, drill bitstick-slip, plugged drill bit nozzles, drill bit nozzle washout, over-or under-sized gauge hole, drill bit wear, mud motor performance loss,drilling-induced formation fractures, ballooning, poor hole cleaning,pipe washout, destructive vibration, accidental sidetracking, twist-offonset, trajectory control of steerable assemblies, rate-of-penetrationoptimization, tool failure diagnostics and/or the like.

Turning now to a second example use of the changepoint detector 901,namely the application thereof to optimize the rate-of-penetration indrilling processes.

Consider again FIG. 5, which illustrates the changes to the linear bitresponse according to the PDC bit model as a drilling operation advancesfrom one formation having one set of characteristics to another. Asdiscussed hereinabove, the data points 509 lie on one line in the threedimensional WOB-bit torque-depth of cut space. And the three data points511 lie on another line in that space. As, discussed above, real-timemodeling of this data is challenging around formation boundaries.Therefore, in an embodiment, a changepoint detector 901 is used todetermine the linear bit response and parameter values that may bederived therefrom. Using the changepoint detector 901 a straight line isfitted through the first set 509 and a second straight line is fittedthrough the second set 511 thereby avoiding polluting estimates for oneformation with data collected from another, for example.

Projecting the three dimensional fit onto the WOB-depth of cut planegives a linear equation linking WOB, RPM and ROP. This can be rearrangedto give ROP as a function of WOB and RPM, as shown by the contours inFIG. 13. Thus, for a given WOB-RPM pair a particular ROP may beexpected.

The coefficients of the bit/rock model allow various constraints to thedrilling process to be expressed as a function of WOB and RPM andsuperimposed on the ROP contours as is illustrated in FIG. 14:

-   -   the ROP at which cuttings are being generated too fast to be        cleaned from the annulus, 141,    -   the WOB that will generate excessive torque for the top drive,        143,    -   the WOB that will generate excessive torque for the drill pipe,        144,    -   the WOB that exceeds the drill bit specification for maximum        weight on bit, 145,    -   the RPM that causes excessive vibration of the derrick, 147.

The region 149 below these constraints is the safe operating envelope.The WOB and RPM that generate the maximum ROP within the safe operatingenvelope may be sought and communicated to the driller. Alternatively,the WOB and RPM may be passed automatically to an autodriller or surfacecontrol system.

Examination of the boundaries of the safe operating window 149 revealthat the highest ROP within the safe operating window may be found atthe intersection of the hole cleaning plot 141 and the top drive torqueplot 143, referred to herein as the optimal parameters 151. For the sakeof example, consider the drilling operation current RPM and WOB beinglocated at 80 rpm and 15 klbf (153), respectively, with an ROP ofapproximately 18 ft/hr. The ROP at the optimal parameter combination151, on the other hand, is approximately 90. Thus, a driller increasingthe RPM and WOB in the direction of the optimal parameters would improvethe ROP. In a preferred embodiment, an ROP optimizer suggests anintermediate combination of RPM and WOB, e.g., the parameter combinationapproximately ½ the distance 155 between the current parametercombination 153 and the optimal combination 151.

The data that defines the ROP contours and the parameters for the safeoperating window are continuously reported from sensors on the drillingapparatus. These sensors may either be located at the surface or in thedrill string. If located at the surface, some filtering andpreprocessing may be necessary to translate the measured values tocorresponding actual values encountered by the drillbit and drillstring.

The continuous stream of data is modeled using the PDC model of FIG. 5.As new data arrives, the best fit for the data points may changeslightly and require minimal adjustments in the model used fordetermining the ROP contours. When encountering new formations, abruptchanges may be expected. The changepoint detector 901 is used to segmentthe incoming data to allow for changes in the model used to calculatethe ROP contours.

FIG. 15 is a graphics user's interface 157 of an ROP optimizer using achangepoint detector 901 to determine segmentation models for the PDCmodel, the ROP contours that may be derived therefrom, the safeoperating envelope, and recommended WOB and RPM parameters. Four windows161 plot WOB, torque, ROP, and RPM, respectively, against a depth index.In another window 163, depth-of-cut is plotted against WOB. In yetanother window 165, torque is plotted against WOB. Finally, torque isplotted against depth-of-cut in yet another window 167.

The data is segmented using the changepoint detector 901 and fit toappropriate linear models corresponding to each segment in the mannerdiscussed hereinabove. The different colors illustrated in the variousgraphs 161 through 167 represent different segments, respectively. Byexamining the plots against depth index of graphs 161 it will beappreciated that in this example, blue represents the first segment,red, the second, and green, the current segment. As will be appreciatedfrom the depth of cut versus WOB graph 163, the linear relationshipexpected between these from the PDC model has changed dramatically inthe course of the drilling operation corresponding to the data pointsplotted in FIG. 15.

The safe operating envelope and drilling contours window 169 contains adisplay of the safe operating envelope 149, the current parameters 153,the optimal parameters 151 and recommended parameters 155 correspondingto the current segmentation model.

The graphic user's interface 157 may be reported on a control consoleconnected to the central surface processor 96.

FIG. 16 is a flow-chart illustrating the operation of the changepointdetector to determine recommended parameters in an ROP optimizerillustrating the operation as new drilling data is received inreal-time. First, the drilling data is segmented using the changepointdetector 901, step 171, in the manner discussed herein above. Thesegmentation divides the data into homogenous segments and associatesmodels to fit to the data in the segment. Thus, at a given time, thereis a best segmentation. That best segmentation further has a currentsegment that corresponds to the most recently arrived drilling data. Thedata fit is performed in real-time thus adjusting the models to take thelatest arrived data into account.

Having determined the best segmentation and the models for the currentsegment these models are used to determine the ROP contourscorresponding to the PDC model fit to the data points in the currentsegment and the safe operating envelope corresponding to the drillingconstraints corresponding to the current segment, step 173.

The ROP contours and safe operating envelope are used to determine theoptimal ROP contour inside the safe operating envelope and the WOB andRPM that correspond to that optimal ROP contour, step 175.

A mud motor or turbine is sometimes added to the bottomhole assembly 56that converts hydraulic power from the mud into rotary mechanical power.With such an assembly, bit RPM is function of surface RPM and mud flowrate, and consequently, the optimum ROP is a function of surface RPM,WOB and flow rate; the algorithm corresponding algorithm thereforesuggests these three drilling parameters to the driller. Therelationship between flow rate and the RPM of the shaft of themotor/turbine is established by experimentation and published by mostvendors. Alternatively by measuring rotor speed downhole, thisrelationship may be inferred in real-time. Given either of theserelationships, the algorithm above can be extended to give an equationof ROP as a function of surface RPM, WOB and flow rate. Useful extraconstraints to add are:

-   -   the flow rate that causes the pressure of the mud in the annulus        to fall below a given value that may cause the borehole to        collapse or formation fluids to enter the wellbore and cause a        kick    -   the flow rate that causes the pressure of the mud in the annulus        to exceed a given value that may cause the borehole to fracture    -   the mechanical power output of the motor at which there is a        risk of motor stalling (reference Walter Aldred et al.,        Optimized Drilling With Positive Displacement Drilling Motors,        U.S. Pat. No. 5,368,108 (Nov. 29, 1994) and Demosthenis Pafitis,        Method For Evaluating The Power Output Of A Drilling Motor Under        Downhole Conditions, U.S. Pat. No. 6,019,180 (Feb. 1, 2000)

A recommended set of new drilling parameters, e.g., RPM and WOB, thatmove the current parameters towards the optimal parameters is provided,step 177, either to a human operator or to an automated drillingapparatus.

The above-described technology for optimizing rate-of-penetration isapplicable to other structures and parameters. In one alternativeembodiment the technique is applied to roller cone bits usingappropriate models for modeling the drilling response of a roller conebit. In yet further alternative embodiments, the above-describedmechanisms are applied to drilling processes that include additionalcutting structures to the bit, such as reamers, under-reamers or holeopeners by including a downhole measurement of WOB and torque behind thedrill bit. In one alternative to that embodiment, a second set ofmeasurements behind the additional cutting structure is included.

In a further alternative embodiment, a bit wear model could be added toallow the bit run to reach the casing point without tripping for a newbit.

Turning now to a third example of the use of a changepoint detector 901in the realm of industrial automation, namely, in directional drillingof wells into targeted subterranean formations. Calculation of wellborecurvature (also known as dogleg severity (“DLS”)) and direction (alsoknown as toolface) are very useful in the field of Directional Drilling.The directional driller uses curvature and direction to predict whetheror not a target will be intersected. In an embodiment of the invention,curvature and direction estimates are provided continuously during adrilling operation on the order of every ½ foot to allow a driller theopportunity to correct the drilling operation if the wellbore isdeviating off plan. The directional driller thus is able to evaluatedeflection tool performance using higher resolution curvature anddirection estimates.

The curvature and direction can be used to determine formation effectson directional drilling. In particular, if the changepoint detectorindicates a changepoint at a formation bed boundary, the new formationwill have a different directional tendency from the previous formation.The resultant curvature and direction can be used to study and evaluatethe effects of surface driving parameters such as weight on bit and rpmon directional performance. A detailed understanding of how currentdeflection tools deviate a well can be used to engineer future tools.Finally, a continuous curvature and direction of the curvature may beused in autonomous and semi-autonomous directional drilling controlsystems.

FIG. 17 is a three-dimensional graph illustrating azimuth andinclination of a wellbore through a three-dimensional space at twodifferent locations. Azimuth 181 a and 181 b at a location is thecompass direction of a wellbore 46 as measured by a directional survey.The azimuth 181 a is usually specified in degrees with respect to thegeographic or magnetic north pole. Inclination 183 a and 183 b at alocation is the deviation from vertical, irrespective of compassdirection, expressed in degrees. Inclination is measured initially witha pendulum mechanism, and confirmed with accelerometers or gyroscopes.

FIG. 18 is a flow-chart illustrating the use of a changepoint detectorin determining real-time estimates for dogleg severity and toolface fromazimuth and inclination data collected during a drilling operation. Thecontinuous inclination and azimuth measurements received from thesesensors on the drilling equipment are processed by a changepointdetection system using a general linear model (changepoint detector).The changepoint detector segments the data into a plurality ofsegmentations and associated segment models as discussed herein above,step 184, resulting in a segmentation, for example, as shown in FIG. 9.

The segmentation step 184 results in a number of different segmentationsof the input azimuth and inclination data. Each is associated with aparticle in a tertiary tree as illustrated in FIG. 7 and has associatedtherewith a list of segments and corresponding models, e.g., ramps andsteps. These segment models are used to estimate the azimuth andinclination at the current drilling location, step 185. Thus, ratherthan accepting the sensor values for azimuth and inclination, thosesensor values being used to adjust the models by being considered by thesegmentation step 184, the azimuth and inclination values used toestimate dogleg severity and toolface are the estimated values obtainedby using the segmentation models. The azimuth and inclination values arecalculated for each active segmentation.

To calculate the azimuth and inclination values at a depth location MD2,using a segmentation p, the following formula is used:DLS _(p) =ACOS(I2−I1)−SIN(I1)*SIN(I2)*(1.0−COS(A2−A1))/(MD2−MD1))  (1)y=COS(A2−A1)*SIN(I2)*SIN(I1)  (2)GTF _(p) =ACOS(COS(I1)*y−COS(I2))/(SIN(I1)*SIN(ACOS(y)))  (3)where:

I1 and I2 are the inclination values computed at the changepoint MD1starting the segment to which the particular depth location MD2 belongsand at the particular depth location MD2 using the inclination modelassociated with the segment to which the particular depth location MD2belongs, respectively;

A1 and A2 are the azimuth values computed at the changepoint MD1starting the segment to which the particular depth location MD2 belongsand at the particular depth location MD2 using the inclination modelassociated with the segment to which the particular depth location MD2belongs, respectively;

DLS_(p) is the dogleg severity at MD2 computed with the segmentation p;and

GTF_(p) is the toolface at MD1 computed with the segmentation p.

Weighted averages are then calculated from the per-segmentationcalculated values for dogleg severity and toolface, step 189, using thefollowing formulas:

${DLS} = {\sum\limits_{p \in \;{Segmentations}}{{DLS}_{p}*{Weight}_{p}}}$${TF} = {A\;{{TAN}\left( \frac{\sum\limits_{p \in \;{Segmentations}}{{{SIN}\left( {TF}_{p} \right)}*{Weight}_{p}}}{\sum\limits_{p \in \;{Segmentations}}{{{COS}\left( {TF}_{p} \right)}*{Weight}_{p}}} \right)}}$

where Segmentations is the set of all active segmentations,

Weight_(p) is the weight associated with a particular segmentation p.

The resulting dogleg severity (“DLS”) and toolface (“TF”) values arethen reported to a directional driller who may use these values toassess the effect of surface driven parameters such a weight-on-bit andRPM on the directional drilling process, step 191. The driller may thenadjust these parameters to improve the trajectory of the wellbore withrespect to a desired target. Alternatively, the resulting doglegseverity (“DLS”) and toolface (“TF”) values are input into an automateddrilling system that automatically adjusts the surface driven parametersbased on these values to improve the wellbore trajectory with respect toa desired target. The resulting dogleg severity (“DLS”) and toolface(“TF”) values may be reported on a control console connected to thecentral surface processor 96.

From the foregoing it will be apparent that a technology has beenpresented herein that provides for a mechanism for real-time or nearreal-time determination of changes in industrial processes in a mannerthat allows operators of such processes, which operators may be humancontrollers, processors, drivers, control systems and/or the like tomake note of/detect events in the operation of a hydrocarbon associatedprocedure, take corrective action if necessary, change operation of theprocedure if desired and/or optimally operate the processes in light ofthe changes in the operating environment, status of the systemperforming the procedure and/or the like. The technology presentedprovides for a mechanism that is noise tolerant, that may be readilyapplied to a variety of hydrocarbon associated processes, and that iscomputationally inexpensive.

The solutions presented may either be used to recommend courses ofaction to operators of industrial processes or as input in processautomation systems. While the techniques herein are described primarilyin the context of exploration for subterranean hydrocarbon resourcesthrough drilling, the techniques are applicable to other hydrocarbonrelated processes, for example, the exploration for water, transport ofhydrocarbons, modeling of production data from hydrocarbon wells and/orthe like.

In the foregoing description, for the purposes of illustration, variousmethods and/or procedures were described in a particular order. Itshould be appreciated that in alternate embodiments, the methods and/orprocedures may be performed in an order different than that described.

It should also be appreciated that the methods described above may beperformed by hardware components and/or may be embodied in sequences ofmachine-executable instructions, which may be used to cause a machine,such as a general-purpose or special-purpose processor or logic circuitsprogrammed with the instructions, to perform the methods. Thesemachine-executable instructions may be stored on one or more machinereadable media, such as CD-ROMs or other type of optical disks, floppydiskettes, ROMs, RAMs, EPROMs, EEPROMs, magnetic or optical cards, flashmemory, or other types of machine-readable media suitable for storingelectronic instructions.

Merely by way of example, some embodiments of the invention providesoftware programs, which may be executed on one or more computers, forperforming the methods and/or procedures described above. In particularembodiments, for example, there may be a plurality of softwarecomponents configured to execute on various hardware devices.Alternatively, the methods may be performed by a combination of hardwareand software.

Hence, while detailed descriptions of one or more embodiments of theinvention have been given above, various alternatives, modifications,and equivalents will be apparent to those skilled in the art withoutvarying from the spirit of the invention. Moreover, except where clearlyinappropriate or otherwise expressly noted, it should be assumed thatthe features, devices and/or components of different embodiments can besubstituted and/or combined. Thus, the above description should not betaken as limiting the scope of the invention, which is defined by theappended claims.

The invention claimed is:
 1. A method for automating or partiallyautomating optimization of a drilling operation in the hydrocarbonindustry, where the drilling operation is subject to a change in one ormore operating conditions, can be controlled by at least one parameterand is monitored by sensors providing input data streams, comprising:receiving input data streams indicative of depth-of-cut,weight-on-bit-and drill-bit rotational speed; upon receiving a new dataitem in one of the input data streams, using a processor to postulatethat the input data stream is segmented according to a plurality ofpossible segmentations, wherein each of the plurality of possiblesegmentations comprises a plurality of segments divided by one or morechangepoints, and wherein the changepoints are indicative of a change inat least one of the one or more operating conditions; evaluating each ofthe plurality of possible segmentations by: fitting portions of theinput data corresponding to each segment in the segmentation beingevaluated to a model corresponding to the each segment in thesegmentation being evaluated; and determining how well the models forthe segments of the segmentation being evaluated fit the portions of theinput data corresponding to each segment of the segmentation beingevaluated; generating an output in the form of a functional relationshipdefining rate-of-penetration (ROP) as a function of weight-on-bit anddrill-bit rotational speed from at least one of the plurality ofpossible segmentations and the models corresponding to the segments ofthe at least one of the plurality of possible segmentations; determiningoperating constraints defining a safe operating envelope as a functionof drill-bit rotational speed and weight-on-bit; determining therotational speed and weight-on-bit parameters that provide the optimalrate-of-penetration location within the safe operating envelope; andoutputting a combination of drill-bit rotational speed and weight-on-bitto move the drill-bit rotational speed and weight-on-bit towards therotational speed and weight-on-bit parameters for the optimalrate-of-penetration location.
 2. The method of claim 1, furthercomprising: periodically removing from consideration segmentationshaving evaluation results indicative of poor model fit of the modelscorresponding to the segments of the segmentation.
 3. The method ofclaim 2, further comprising: upon receiving additional data in the inputdata stream, only considering as the possible segmentations anysegmentations remaining after removing from consideration thesegmentations having evaluation results indicative of poor model fit. 4.The method of claim 1, wherein the models are selected from stepfunctions and ramp functions.
 5. The method of claim 1, wherein the stepof evaluating each of the plurality of possible segmentations comprisesusing Bayesian Model Selection to assign weights to each segment in eachsegmentation, and wherein the weight associated with each segment is anaccuracy measurement of the models corresponding to the segment fit tothe data associated with the segment.
 6. The method of claim 1, whereinthe step of fitting portions of the input data corresponding to eachsegment in the segmentation being evaluated is performed using linearregression.
 7. The method of claim 1, further comprising: creating atreestructure having nodes representing particles corresponding toparticular segmentations, where at index i, a set of particles (parentparticles), each corresponding to a particular segmentation, are heldactive; and for each new data item received from the input data streamat index i+1, creating a plurality of child nodes to each node activeparent particle node, each child node corresponding to either acontinuation of the segment to which the parent particle nodecorresponds or a start of a new segment with a new model.
 8. The methodof claim 2, further comprising representing each possible segmentationfor n data points as a plurality of particles, wherein the removal stepcomprises removing from consideration particles representing poor-fitsegmentations.
 9. The method of claim 8, further comprising uponreceiving an additional data point (n+1) on the input data, spawningadditional particles as child particles from each active particle andcorresponding to each new possible segmentation involving the new datapoint.
 10. The method of claim 1, wherein the step of using the outputto control at least one parameter of the hydrocarbon industry processcomprises: indicating to a controller of the at least one parameter thata likely change of operating condition has occurred; and adjusting theat least one parameter in response to the indication that a likelychange of operating condition has occurred.
 11. The method of claim 1,wherein generating an output from at least one of the plurality ofpossible segmentations and the models corresponding to the segments ofthe at least one of the plurality of possible segmentations comprises:computing a probability of a first condition having occurred; feedingthe probability of the first condition having occurred into an inferenceengine; operating the inference engine to determine whether a firstevent has occurred.
 12. The method of claim 11, computing a probabilityof a first condition having occurred comprises computing a value as afunction of the models corresponding to the segments of eachsegmentation under consideration, comparing that value to a thresholdcondition, and declaring that the probability of the first conditionhaving occurred as the weighted sum of the probabilities associated withthe segmentation for which the computed value satisfies the thresholdcondition.
 13. The method of claim 11, further comprising: inputting atleast one additional probability of a second condition having occurredinto the inference engine; operating the inference engine to determinethe probability of each of the first event and of a second event havingoccurred causing the first condition to occur.
 14. The method ofoperating an automated drilling apparatus of claim 1, furthercomprising: defining the functional relationship betweenrate-of-penetration, weight-on-bit and drill-bit rotational speed as afirst functional relationship between rate of penetration andweight-on-bit and from the first functional relationship defining asecond functional relationship defining rate-of-penetration as afunction of drill-bit rotational speed and weight- on-bit; and uponreceiving additional measurements of depth-of-cut, weight-on-bit anddrill-bit rotational speed, updating the functional relationship betweendepth-of-cut and weight-on-bit and the second functional relationshipdefining rate-of-penetration as a function of drill-bit rotational speedand weight-on-bit, and the operating constraints defining the safeoperating envelope.
 15. The method of operating an automated drillingapparatus of 14, wherein the step of updating the functionalrelationship defining rate-of-penetration as a function of drill-bitrotational speed and weight-on-bit comprises: postulating that the datastreams are segmented according to a plurality of possible segmentsdivided by changepoints each indicative of a change in operatingcondition; evaluating each segmentation by: fitting the input streamdata corresponding to each segment in the segmentation to a modelcorresponding to the each segment in the segmentation; and evaluatingthe segmentations by determining how well the models for the segments ofeach segmentation fit the input data corresponding to each segment ofeach segmentation; and using at least one of the most likelysegmentations and the models corresponding to the segments of the atleast one most likely segmentations to determine the functionalrelationship between depth-of-cut and weight-on-bit and the secondfunctional relationship defining rate-of-penetration as a function ofdrill-bit rotational speed and weight-on-bit, and the operatingconstraints defining the safe operating envelope.
 16. The method ofoperating an automated drilling apparatus of 15, further comprising:removing from consideration any segmentations having low probability ofproviding a close-fit modeling of the data streams.
 17. The method ofoperating an automated drilling apparatus of 15, further comprising:upon receiving an additional data point, postulating furthersegmentations based on currently active segmentations and possiblealternative segmentations deriving from the active segmentations whereinfor each active segmentation the possible alternative segmentationsrepresent continuation of the each active segmentation, and newsegmentations representing alternative models for the receivedadditional data point.
 18. A hydrocarbon industry drilling controlsystem connected to sensors that produce streams of input dataindicative of depth-of-cut, weight-on-bit and drill-bit rotationalspeed, comprising: a processor with a communications connection toreceive the streams of input data; a storage system comprisingprocessor-executable instructions that comprises instructions to causethe processor to: upon receiving a new data item from the input datastreams: postulating that the data stream is segmented according to aplurality of possible segmentations each comprising a plurality ofsegments divided by changepoints each changepoint indicative of a changein operating condition; evaluating each segmentation by: fitting theinput stream data corresponding to each segment in the segmentation to amodel corresponding to the each segment in the segmentation; andevaluating the segmentations by determining how well the models for thesegments of each segmentation fit the input data corresponding to eachsegment of each segmentation; and using at least one of thesegmentations and the models corresponding to the segments of the atleast one of the segmentations as input to a control program controllingat least one parameter of the process in the hydrocarbon industry, by:determining operating constraints defining a safe operating envelope asa function of drill-bit rotational speed and weight-on-bit; determiningthe rotational speed and weight-on-bit parameters that provide theoptimal rate-of-penetration location within the safe operating envelope;and outputting a combination of drill-bit rotational speed andweight-on-bit to move the drill-bit rotational speed and weight-on-bittowards the rotational speed and weight-on-bit parameters for theoptimal rate-of-penetration location.
 19. The control system of claim18, wherein the processor-executable instructions further comprisesinstructions to cause the processor to: periodically remove fromconsideration segmentations having evaluation results indicative of poormodel fit of the models corresponding to the segments of thesegmentation; and upon receiving additional data on the data stream onlyconsider further segmentations based upon segmentations that remainafter the removing from consideration segmentations having evaluationresults indicative of poor model fit.
 20. The control system of claim18, wherein the models are selected from step functions and rampfunctions.
 21. The control system of claim 18, wherein the instructionsto evaluate each segmentation cause the processor to perform a BayesianModel Selection to assign weights to each segment in each segmentationwherein the weight associated with each segment is an accuracymeasurement of the models corresponding to the segment fit to the dataassociated with the segment.
 22. The control system of claim 18, whereinthe fitting of the input data stream data corresponding to each segmentin the segmentation is performed using linear regression.
 23. Thecontrol system of claim 18, wherein the processor-executableinstructions further comprises instructions to cause the processor to:create a treestructure having nodes representing particles correspondingto particular segmentations; to, at index i, hold active a set ofparticles (parent particles), each corresponding to a particularsegmentation; for each new data item received from the input data streamat index i+1, creating a plurality of child nodes to each node activeparent particle node, each child node corresponding to either acontinuation of the segment to which the parent particle nodecorresponds or a start of a new segment with a new model.
 24. Thecontrol system of claim 19, wherein the processor-executableinstructions further comprises instructions to cause the processor to:represent each possible segmentation for n data points as a plurality ofparticles; wherein the removal step comprises removing fromconsideration particles representing poor-fit segmentations; and uponreceiving an additional data point (n+1), spawning additional particlesas child particles from each active particle and corresponding to eachnew possible segmentation involving the new data point.
 25. The controlsystem of claim 18, wherein the instruction to use at least one of thesegmentations and the models corresponding to the segments of the atleast one of the segmentations to a control program controlling at leastone parameter of the process in the hydrocarbon industry compriseinstructions to cause the processor to indicate to a controller of theat least one parameter that a likely change of operating condition hasoccurred; and adjusting the at least one parameter in response to theindication that a likely change of operating condition has occurred. 26.The control system of claim 18, wherein the instructions to use at leastone of the segmentations and the models corresponding to the segments ofthe at least one of the segmentations as input to a control programcontrolling at least one parameter of the process in the hydrocarbonindustry comprises instructions to cause the processor to: compute aprobability of a first condition having occurred; feed the probabilityof the first condition having occurred into an inference engine; andoperate the inference engine to determine whether a first event hasoccurred.
 27. The control system of claim 26, wherein the instructionsto compute a probability of a first condition having occurred comprisesinstructions to cause the processor to compute a value as a function ofthe models corresponding to the segments of each segmentation underconsideration, comparing that value to a threshold condition, anddeclaring that the probability of the first condition having occurred asthe weighted sum of the probabilities associated with the segmentationfor which the computed value satisfies the threshold condition.
 28. Thecontrol system of claim 18, wherein the processor-executableinstructions further comprises instructions to cause the processor to:input at least one additional probability of a second condition havingoccurred into the inference engine; operate the inference engine todetermine the probability of each of the first event and of a secondevent having occurred causing the first condition to occur.
 29. Thedrilling control system of claim 18, wherein the determining of afunctional relationship defining rate-of-penetration (ROP) as a functionof weight-on-bit and drill-bit rotational speed comprises: defining thefunctional relationship between rate-of-penetration, weight-on-bit anddrill-bit rotational speed as a first functional relationship betweenrate of penetration and weight-on-bit and from the first functionalrelationship defining a second functional relationship definingrate-of-penetration as a function of drill-bit rotational speed andweight-on-bit ; and upon receiving additional measurements ofdepth-of-cut, weight-on-bit and drill-bit rotational speed, updating thefunctional relationship between depth-of-cut and weight-on-bit and thesecond functional relationship defining rate-of-penetration as afunction of drill-bit rotational speed and weight-on-bit, and theoperating constraints defining the safe operating envelope.
 30. Thedrilling control system of claim 29, wherein updating the functionalrelationship defining rate-of-penetration as a function of drill-bitrotational speed and weight-on-bit comprises: postulating that the datastreams are segmented according to a plurality of possible segmentsdivided by changepoints each indicative of a change in operatingcondition; evaluating each segmentation by: fitting the input streamdata corresponding to each segment in the segmentation to a modelcorresponding to the each segment in the segmentation; and evaluatingthe segmentations by determining how well the models for the segments ofeach segmentation fit the input data corresponding to each segment ofeach segmentation; and using at least one of the most likelysegmentations and the models corresponding to the segments of the atleast one most likely segmentations to determine the functionalrelationship between depth-of-cut and weight-on-bit and the secondfunctional relationship defining rate-of-penetration as a function ofdrill-bit rotational speed and weight-on-bit, and the operatingconstraints defining the safe operating envelope.
 31. The drillingcontrol system of claim 30, updating the functional relationshipdefining rate-of-penetration as a function of drill-bit rotational speedand weight-on-bit comprises: removing from consideration anysegmentations having low probability of providing a close-fit modelingof the data streams.
 32. The drilling control system of claim 30,updating the functional relationship defining rate-of-penetration as afunction of drill-bit rotational speed and weight-on-bit comprises: uponreceiving an additional data point, postulating further segmentationsbased on currently active segmentations and possible alternativesegmentations deriving from the active segmentations wherein for eachactive segmentation the possible alternative segmentations representcontinuation of the each active segmentation, and new segmentationsrepresenting alternative models for the received additional data point.